<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Online Judge后台登陆界面</title>
<link rel="SHORTCUT ICON" href="../image/logo.png">
<link rel="BOOKMARK" href="../image/logo.png">
<link href="../css/bootstrap.min.css" rel="stylesheet">
<!-- css内容较少，直接写这里了 -->
<style type="text/css">
body,html {
	width: 100%;
	height: 100%;
	background: #444 url("img/loginBg.jpg");
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center center;
	background-attachment: fixed;
	background-repeat: no-repeat;
	background-position: center center;
}

#content {
	position: absolute;
	top: 50%;
	height: 300px;
	margin-top: -150px;
	width: 100%;
	text-align: center;
}

#title {
	position: relative;
	top: -32%;
	display: inline-block;
	width: 300px;
	height: 100%;
	color: white;
	text-align: right;
	margin-right: 30px;
}

#round {
	width: 100px;
	height: 100px;
	border-radius: 50px 50px 50px 50px;
	background: rgba(55, 236, 186, 1);
	text-align: center;
	display: inline-block;
}

#round h3 {
	margin: 0;
	padding: 0;
	margin-top: 25px;
}

#form {
	position: relative;
	background: rgb(255, 255, 255);
	width: 300px;
	height: 100%;
	display: inline-block;
	margin-right: 180px;
	text-align: left;
	padding-left: 20px;
	padding-right: 20px;
	padding-top: 50px;
}

#form div div {
	padding-bottom: 20px;
}

#submitButton {
	width: 100%;
}

#author {
	color: black;
	position: absolute;
	bottom: 0;
	width: 100%;
	text-align: center;
}
</style>
</head>
<body>
	<div id="content">
		<div id="title">
			<h1>
				Online Judge<br />后台管理
			</h1>
			<div id="round">
				<h3>
					用户<br>登录
				</h3>
			</div>
		</div>
		<div id="form">
			<div class="form-group">
				<div>管理员账号：</div>
				<div>
					<input type="text" class="form-control" id="account">
				</div>
				<div>密码：</div>
				<div>
					<input type="password" class="form-control" id="password">
				</div>
				<p id="message"></p>
				<button id="submitButton" class="btn btn-primary" type="submit"
					onclick="submit()">登陆</button>
			</div>
		</div>
	</div>
	<p id="author">
		<a href="http://www.supermanl.cn/">@by liang</a>
	</p>
</body>
<script src="../js/jquery.min.js"></script>
<script type="text/javascript">
	function submit() {
		$.ajax({
			type : "post",
			url : "../AdminManagerController/login",
			data : {
				account : $("#account").val(),
				password : $("#password").val()
			},
			async : false,
			dataType : "json",
			success : function(respones) {
				if (respones.success) {
					window.location = "index.html";
				}
			},
			error : function(respones) {
				$("#message").html(respones.responseJSON.message);
			},
		});
	}
</script>
</html>
